<?php
	ob_start();
	session_start();
	require("../librarys/funcs/Manager.php");
	require("../librarys/funcs/Utils.php");
	$util = new Utils();
	if (isset($_SESSION['is_login']) == false && $_SESSION['is_login'] != 1 && $_SESSION['is_admin'] != 1) {
		$util->redirect("login.php");
	}
	if (isset($_GET['logout']) && $_GET['logout'] == 1) {
		unset($_SESSION['is_login']);
		unset($_SESSION['display_name']);
		unset($_SESSION['user_id']);
		if (isset($_SESSION['is_admin']))
			unset($_SESSION['is_admin']);
		$util->redirect("login.php");
	}
	$conn = new Connection();
	$p    = $_GET['p'];
	$t    = $_GET['t'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>Trang quản lý</title>
    <link href="../bootstrap/css/bootstrap.css" rel="stylesheet"/>
    <link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet"/>
    <link href="css/style.css" rel="stylesheet"/>

    <script type="text/javascript" src="../js/jquery/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.validate.js"></script>
    <script type="text/javascript" src="../bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="../js/jquery/fileuploader.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.form.js"></script>

    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="ckfinder/ckfinder.js"></script>

    <script type="text/javascript" src="../js/core.js"></script>
    <script type="text/javascript" src="js/profile.js"></script>
</head>

<body>
<? include_once 'nav.php' ?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span2">
			<? include_once 'menu.php' ?>
        </div>
        <div class="span10">
			<? include_once 'breadcrumb.php' ?>
			<?
			if ($p == "profile") {
				include_once('inc/user/profile.php');
			}
			if ($p == "user") {
				if ($t == "add") {
					include_once('inc/user/user_add.php');
				} elseif ($t == "edit") {
					include_once('inc/user/user_edit.php');
				} else {
					include_once('inc/user/user.php');
				}
			}
			if ($p == "updatepassword") {
				include_once('inc/user/updatepassword.php');
			}
			if ($p == "page") {
				if ($t == "add") {
					include_once('inc/page/page_add.php');
				} elseif ($t == "edit") {
					include_once('inc/page/page_edit.php');
				} else {
					include_once('inc/page/page.php');
				}
			}
			if ($p == "gallery") {
				if ($t == "add") {
					include_once('inc/gallery/gallery_add.php');
				} elseif ($t == "edit") {
					include_once('inc/gallery/gallery_edit.php');
				} else {
					include_once('inc/gallery/gallery.php');
				}
			}
			if ($p == "catalog") {
				if ($t == "add") {
					include_once('inc/catalog/catalog_add.php');
				} elseif ($t == "edit") {
					include_once('inc/catalog/catalog_edit.php');
				} else {
					include_once('inc/catalog/catalog.php');
				}
			}
			if ($p == "catalog1") {
				if ($t == "add") {
					include_once('inc/catalog1/catalog1_add.php');
				} elseif ($t == "edit") {
					include_once('inc/catalog1/catalog1_edit.php');
				} else {
					include_once('inc/catalog1/catalog1.php');
				}
			}
			if ($p == "product") {
				if ($t == "add") {
					include_once('inc/product/product_add.php');
				} elseif ($t == "edit") {
					include_once('inc/product/product_edit.php');
				} else {
					include_once('inc/product/product.php');
				}
			}
			?>
        </div>
    </div>
</div>
</body>
</html>
